<div class="page-content" >
            
    <div class="panel panel-default">
			 <div class="panel-heading">
          添加热门动态
			</div>
        <div class="panel-body">
             <form  class="form-horizontal" enctype="multipart/form-data"  enctype="multipart/form-data" action="<{:U('subject/subject_new_add')}>" method="post" id="myform">
            	  <input type="hidden"  name="id" value="<{$data.id}>">
           
                    	<div class="form-group">
                            <label for="input-title" class="col-sm-2 control-label">标题</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control" id="title" name="title" value="<{$data.title}>">
       
                            </div>
                        </div>
																								
																								<div class="form-group">
                            <label for="input-title" class="col-sm-2 control-label">用户ID</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control" id="user_id" name="user_id" value="<{$data['user_id']?$data['user_id']:'100110'}>">
       
                            </div>
                        </div>
						
						<div class="form-group">
                            <label  class="col-sm-2 control-label">类型</label>
                            <div class="col-sm-7">
							<select name="pid" class="form-control" onchange="select_type_array(this)">
                             <volist name="type_array" id="vo">
							<option <if condition="$key eq $data['pid']">selected="selected"</if> value="<{$key}>"><{$vo}></option>
							</volist>
                            </select>&nbsp;&nbsp;(校园动态时，不用选所属班级)
							</div>
                        </div>
						 
						<div class="form-group" id="classrooms_list">
                            <label  class="col-sm-2 control-label">所属班级</label>
                            <div class="col-sm-7">
							<select name="pid2" class="form-control">
							<option value="0">请选择班级</option>
                             <volist name="classrooms_list" id="vo">
							<option <if condition="$vo['subjectid'] eq $data['pid2']">selected="selected"</if> value="<{$vo['subjectid']}>"><{$vo.subject}></option>
							</volist>
                            </select>
                               
                            </div>
                        </div>
			
						 
                         
 

                        <div class="form-group">
                            <label for="textarea-content" class="col-sm-2 control-label">内容</label>
                            <div class="col-sm-7">
                                <textarea style="width: 680px; height: 400px;" class="input_a1" id="textarea-content" name="content" rows="2"><{$data.content}></textarea>
                                 
                            </div>
                        </div>
                       
                        <div class="form-group">
                            <div class="col-sm-7" align="center">
                                <button class="btn btn-default"  type="submit">确认保存</button>
                            </div>
                        </div>
                        
                      
                        
                    
                </form>
        </div>
    </div>
   

</div>

<link rel="stylesheet" href="__PUBLIC__/kindeditor-4.1.10/themes/default/default.css" />
<script charset="utf-8" src="__PUBLIC__/kindeditor-4.1.10/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditor-4.1.10/lang/zh_CN.js"></script>
<script type="text/javascript">
    var editor ;
	KindEditor.ready(function(K) {
		
		editor = K.create('textarea[name="content"]', {
			resizeType : 1,
			allowPreviewEmoticons : false,
			allowImageUpload : true,
			formatUploadUrl:false,
   uploadJson : '<php>echo "http://".$_SERVER["HTTP_HOST"];</php><{:api_url("Kindeditor/uploadJson")}>',
		});

	 
	});
	
	
	function select_type_array(_this){
		 var v=$(_this).val();
			if(v==1){
			  $("#classrooms_list").show();
			}else{
			 $("#classrooms_list").hide();
				$("[name='pid2']").find("option").eq(0).attr("selected","selected");
				$("[name='pid2']:eq(0)").val(0);
			}
	}
	
	$(function(){
	  select_type_array($("[name='pid']"));	
	})
</script>


 